import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/LoginView.vue")
  },
  {
    path: "/",
    name: "layout",
    meta: { title: "管理系统" },
    component: () => import("@/LayoutView.vue"),
    children: [
      {
        path: "home",
        name: "home",
        meta: { title: "主页" },
        component: () => import("@/views/HomeView.vue"),
      },
      {
        path: "user",
        name: "user",
        meta: { title: "用户管理" },
        component: () => import("@/views/UserView.vue"),
      },
      {
        path: "banner",
        name: "banner",
        meta: { title: "轮播图" },
        component: () => import("@/views/BannerView.vue"),
      },
      {
        path: "work_life",
        name: "work_life",
        meta: { title: "工作生活" },
        component: () => import("@/views/categorys/WorkLife.vue"),
      },
      {
        path: "skill_learn",
        name: "skill_learn",
        meta: { title: "技能学习" },
        component: () => import("@/views/categorys/SkillLearn.vue"),
      },
      {
        path: "my_hobby",
        name: "my_hobby",
        meta: { title: "兴趣爱好" },
        component: () => import("@/views/categorys/MyHobby.vue"),
      },
      {
        path: "publish_article",
        name: "publish_article",
        meta: { title: "发布文章" },
        component: () => import("@/views/articles/PublishArticle.vue"),
      },
      {
        path: "article_list",
        name: "article_list",
        meta: { title: "文章列表" },
        component: () => import("@/views/articles/ArticleList.vue"),
      },
      {
        path: "setting",
        name: "setting",
        meta: { title: "系统界面设置" },
        component: () => import("@/views/SettingView.vue"),
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
